#ifndef TOKEN_H
#define TOKEN_H

#include <string>

#include <tr1/unordered_map>

using namespace std;
using namespace std::tr1;

enum TokenType{
    Token_None,
    Token_Variable,
    Token_String,
    Token_Char,
    Token_Int,
    Token_Hex,
    Token_Float,
    Token_Comment,
    TokenKey_Package,
    TokenKey_Import,
    TokenKey_Enum,
    TokenKey_Public_Enum,
    TokenKey_Private_Enum,
    TokenKey_Interface,
    TokenKey_Public_Interface,
    TokenKey_Private_Interface,
    TokenKey_Class,
    TokenKey_Public_Class,
    TokenKey_Private_Class,
    TokenKey_Function,
    TokenKey_Null,
    TokenOpt_Get,
    TokenOpt_End,
    TokenOpt_Comment,
    TokenOpt_BlockStart,
    TokenOpt_BlockEnd,
    TokenOpt_Extends,
    TokenOpt_IndexStart,
    TokenOpt_IndexEnd,
    TokenOpt_BracketStart,
    TokenOpt_BracketEnd,

    //操作运算符号
    TokenOpt_Add,
    TokenOpt_AddE,
    TokenOpt_Sub,
    TokenOpt_SubE,
    TokenOpt_Mul,
    TokenOpt_MulE,
    TokenOpt_Div,
    TokenOpt_DivE,
    TokenOpt_Mod,
    TokenOpt_ModE,
    TokenOpt_Equl,
    TokenOpt_More,
    TokenOpt_Less,
    TokenOpt_MoreE,
    TokenOpt_LessE,
    TokenOpt_EEqul,
    TokenOpt_NEqul,
    TokenOpt_Not,
    TokenOpt_BNot,
    TokenOpt_BAnd,
    TokenOpt_BAndE,
    TokenOpt_And,
    TokenOpt_Or,
    TokenOpt_BOr,
    TokenOpt_BOrE,
    TokenOpt_Xor,
    TokenOpt_XorE
    TokenOpt_Inc,
    TokenOpt_Dec,
    TokenOpt_LShift,
    TokenOpt_LShiftE,
    TokenOpt_RShift,
    TokenOpt_RShiftE
};

class Token
{
    public:
        Token();
        Token(Token *ptoken);
        virtual ~Token();
        int line;
        int column;
        const string *pstr; //值
        TokenType type; //符号类型
        void checkKey();
        Token* clone();
    protected:
    private:
        static pair<string, TokenType> keyMap[];
        static unordered_map<string,TokenType> keySet;

};

#endif // TOKEN_H
